﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Commerce/Views/Shared/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:"Products".Localize() %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var categoryid = ViewContext.RouteData.GetRequiredString("id");%>
    <h3 class="title">
        <%: "Product list".Localize()%></h3>
    <div class="command">
        <ul class="clearfix">
            <li>
                <%: Html.ActionLink("Edit Category".Localize(),"edit",new { id = categoryid }, new {@class="button",name="command"}) %>
            </li>
            <%  var category = ViewData["Category"] as ICategory;
                var list = ViewData["ProductTypes"] as IEnumerable<IProductType>;
                if (list.Count() > 0)
                { %>
            <li>
                <div class="dropdown-button">
                    <span>
                        <%: "Add Product".Localize()%></span>
                    <ul class="hide">
                        <% 
                            foreach (var item in list)
                            { %>
                        <li>
                            <%: Html.ActionLink(item.Name, "create", "Product", new {producttypeid=item.Id,categoryid=categoryid },null)%>
                        </li>
                        <%} %>
                    </ul>
                </div>
            </li>
            <%}%>
        </ul>
    </div>
    <%: Html.Partial("ProductList") %>
</asp:Content>
